# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=alembic
pkgver=1.8.3
pkgrel=3
pkgdesc="Open framework for storing and sharing scene data"
url="https://www.alembic.io/"
arch="all !s390x" # alembic does not support big-endian, which s390x uses
license="BSD-3-Clause"
makedepends="openexr-dev hdf5-dev zlib-dev cmake boost-dev samurai"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/alembic/alembic/archive/$pkgver.tar.gz"

build() {
	CXXFLAGS="$CXXFLAGS -flto -fno-ipa-cp"
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DUSE_HDF5=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
0049c72d93e66e12d704d27e7ba36cd9c718667f2ce4f7baa1bee1613ed88ba53abea98f457e14f7f2144cb353810a4108d26c7dd1a1543ec2af576272f19036  alembic-1.8.3.tar.gz
"
